<template name="zEnrollAnsPanel">
	<view  class="col-arrange">
		<view v-for="(ans,index) in answer" :key="index">
			
			<view class="col-arrange enroll-item dashboard">
				<view class="item-bar">
					<text class="item-name">{{index+1}}.问题</text>
					<text class="item-content">{{ans.que}}</text>
				</view>
				<view class="item-bar" v-if="ans.type!='zpicture'">
					

					<text class="item-name" v-if="ans.type != 'zpicture'">答案</text><text class="item-content">{{JSON.stringify(ans.ans)}}</text>
				</view>
				<view v-else>
					<image style="margin-left:50upx;height:500upx;"  mode="aspectFill" v-if="ans.type=='zpicture' && ans.ans != 'noImage'" :src="realUrl(ans.ans)"/>
					<text style="margin-left:520upx;" v-if="ans.type=='zpicture' && ans.ans == 'noImage'">用户没有上传照片</text>
				</view>
				
				
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		name : "zEnrollAnsPanel",
		data() {
			return {
				
			};
		},
		props : { 
			answer : {
				type : Array,
				default : []
			}
		},
		created : function(){
			// console.log(this.answer)
		},
		methods : {
			realUrl : function(srcJson){
				var serverConfig = this.serverConfig;
				return 'http://' + serverConfig[srcJson.hostId] + '/pic/' + srcJson.filename;
			}
		}
	}
</script>

<style>
	@import "../../common/zcss.css";

	.enroll-item{
		border: 1upx solid gray;
		/* border-top: 1upx solid gray; */
		height : 100%;
		width: 100%;
		/* height:120upx; */
		/* padding-top: 5rpx; */
		/* background-color: white; */
		position: relative;
		/* margin-bottom: 5rpx; */
	}
	.item-bar{
		height:60rpx;
		position: relative;
	}
	.item-name{
		position: absolute;
		left: 1%;
		color: gray;
	}
	.item-content{
		position: absolute;
		right: 1%;
	
	}
</style>
